 <%@ page contentType="text/html; charset=UTF-8"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
 <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
 <html>
    <head>
       <link href="
       <s:url value="resources/css/main.css"/>
       " rel="stylesheet" type="text/css"/>
    </head>
    <body>
       <center>

          <table align=center>
             <tr>
                <td>
                   <h1>
                      <s:if test="custOrder==null || custOrder.orderId == null">
                         <s:text name="label.custOrder.add"/>
                      </s:if>
                      <s:else>
                         <s:text name="label.custOrder.edit"/>
                      </s:else>
                   </h1>
                </td>
             </tr>
          </table>
          <table width=600 align=center>
             <tr>
                <td><a href="getAllCustOrders.html">Click Here to View Employees</a></td>
             </tr>
          </table>
          <table>
             <tr>
                <td align="left" style="font:bold;color:red">
                   <s:fielderror/>
                   <s:actionerror/>
                   <s:actionmessage/>
                </td>
             </tr>
          </table>
          <s:form>
             <table align="center" class="borderAll">
                <s:hidden name="custOrder.orderId " />
                                <s:hidden name="criteria" value="A0"/>
                                <s:hidden name="criteriaSubId" value="1"/>

                <tr>
                   <td class="tdLabel">
                      <s:text name="label.custOrder.orderDate"/>
                   </td>
                   <td>
                      <s:textfield name="custOrder.orderDate" size="30"/>
                   </td>
                </tr>

                <tr>
                   <td class="tdLabel">
                      <s:text name="label.custOrder.requiredDate"/>
                   </td>
                   <td>
                      <s:textfield name="custOrder.requiredDate" size="30"/>
                   </td>
                </tr>

                <tr>
                   <td class="tdLabel">
                      <s:text name="label.custOrder.shippedDate"/>
                   </td>
                   <td>
                      <s:textfield name="custOrder.shippedDate" size="30"/>
                   </td>
                </tr>


                <tr>
                   <td class="tdLabel">
                      <s:text name="label.custOrder.customer"/>
                   </td>
                   <td>
                      <s:select name="custOrder.customer.id"
                         list="#session.customerList"
                         listKey="id"
                         listValue="id"
                         multiple="false"
                         />
                   </td>
                </tr>

                <tr>
                   <td class="tdLabel">
                      <s:text name="label.custOrder.salesman"/>
                   </td>
                   <td>
                      <s:select name="custOrder.salesman.id"
                         list="#session.salesmanList"
                         listKey="id"
                         listValue="id"
                         multiple="false"
                         />
                   </td>
                </tr>
                <tr>
                   <td class="tdLabel">
                      <s:text name="label.custOrder.payment"/>
                   </td>
                   <td>
                      <s:select name="custOrder.payment.paymentId"
                         list="#session.paymentList"
                         listKey="paymentId"
                         listValue="paymentId"
                         multiple="false"
                         />
                   </td>
                </tr>
                 <tr>
                    <td class="tdLabel">
                       <s:text name="label.custOrder.shippingAddress"/>
                    </td>
                    <td>
                       <s:select name="custOrder.shippingAddress.addressId"
                          list="#session.addressList"
                          listKey="addressId"
                          listValue="addressId"
                          multiple="false"
                          />
                    </td>
                 </tr>

             </table>
             <br/>
             <table>
                <tr>
                   <td>

                    <s:if test="custOrder==null || custOrder.orderId == null">
                         <s:submit action="custOrderInsert" key="button.label.submit" cssClass="butStnd"/>
                       </s:if>
                       <s:else>
                         <s:submit action="custOrderUpdate" key="button.label.submit" cssClass="butStnd"/>
                       </s:else>

                   </td>
                   <td>
                      <s:reset key="button.label.cancel" cssClass="butStnd" action="custOrderInsertOrUpdate" />
                   </td>
                <tr>
             </table>
          </s:form>
       </center>
    </body>
 </html>